replaced implementation of getIfiniteSequence by iterate. Speed up by 3 seconds!!