First draft of Java conversion