Added a lot more javadoc