Made compliant with java 5