Added the reduction step
Everything works except it segfaults with large n and epsilon