Hopefully fixed sensor code