check in week 5 assignment - some improvements and error checking/reporting