Added more java packages, replaced System.out.print() by logger, small tweaks to the code