added sensor logic and tests