Start writing javadoc and improving comments