tabbify and cleaned up std issues and min/max problems.