added half of IR sensor code)