refactored the 3 columns code that become one when too narrow