Updated code to Java 5.