made compatible with java 6 source