Moved try to its own file, rewrote main loop