Added the beginnings of the java implementation