Assignment Finished

Added programming logic, added error handling. Should work fine now.