Working on code for comparison calculations