Cleaned up main function a little