Corrected Java version.
Added some comments.