first commit; breaking up the main code into smaller parts