Added javadoc style documentation to functions and classes