Added in exception logic

Finished the assignment.