Initial work on Java version