Squash program into methods

void loop now calls methods to do their function (more clear)