moved loops to control.h
started definition classes