Successful implementation, tested against 1, 2 and 4096 iterations