simplified Codes.java