Java code written for a CS class in 2011