Added javadoc headers to all new functions and fixed a few old ones