JavaDoc and Reformat

Javadoc'd a lot and reformatted some code to clean it up