cw 2nd try now in java :D