Cleaning the code of the bedsensor