Added in some exception handling, though it's not done well. Need to think more. Going home.