java code cleaned up, beleg updated