Fixes and improvements
Added Javadoc and cleaning