Modified to take more than 1 column
Added ability for more than 2 columns