Adding Java code for honor coding, being as the C code isn't actually complete