add sensor code
formatting
better formatting