added some base functionality to main, cleaned up errors