now compatible with earlier versions of PHP