use slice to iterate through records