changing loop indexes to pointers
replacing len with length calc
adding second record test
adding loop around function