adding sensor code-not tested