Added comments and Javadocs. Need only more logging