changed sensor reads to a for-loop, changed variable names