NOT TESTED - updated to allow more than one sensor

yet to be tested