Added x_sensor, and some test functions for x_sensor