Adding level sensor code