updates to env detection, incomplete