updated sensor code