added some methods to detect which device code is running on