overloaded getColumns to handle 3 dimensions