updated javadoc, added methods, made some methods final