second iteration (costs a bit more but it works faster and is a bit more compact)