Added horizontal overflow handling