initial commit to control.c
Not working yet. Not testable since main is not implemented.