started working on java version