Cleaned up main (again) This has the post error fixed.