Revised register.java