adds proper columns and column sorting