First Commit HW #4

first attempt, finished error messages and opening files for parts A &
B.