made code java 7 compliant