Updated for Java 1.7