function to compare records started