still in the middle of error handling
The program should now be safe enough to operate, make sure to test properly first.