Added option for custom number of iterations and some basic javadocs