Working on compare function