formatting table to console
clean up some unneccessary code