converted to Java 7, and removed simple warnings