now compatible with older matlab