Added touch and motion sensor functions