adding javadoc
simplifying code
using os independent path
code simplification