initial encode.java