Enhanced to handle multiple sensors