code to compare