added determine id function