First cut working version without printing in the output format
Working assignment with very few error checks