cleaned up code and fixed column issues