Updated code documentation and changed javadoc