Wrong Javadoc corrected
Removed unused variables
Added tests