added javadocs and comments to everything