Added Javadocs and used the Iterable functionality to clean up some code
Added Javadocs