cleaned up main a little in lieu of proper error handling