initial code to find records