Added documentation and javadoc