debugged gas sensor code