Started writing sensor functions