refactored for column legnth