Creates functioning loop program