Refactored code to be Java 6 compliant.