Added javadoc and updated the controller