using Java 6 for compatibility