Added reordering limit, jUnit tests for Main and javadoc