Updated to use array index as DB column