bug fixes and added javadoc files