compatible with java 1.5 onwards