Made compatible with Java 7