Cleaned up main to actually do something.