Updated syntax to suppot java 5 and 6