Replaced hard-coded columns with a dynamic method.