added first revision of code for sensors 2 and 3