Fixed update() issue and added Javadoc