Split lab 6 into parts 1 and 2

mainpart1.c contains the entire code for part 1, part 2 is still being
worked on.