Changed how columns are referenced

Removed hard coded column numbers from if statements