Refactored my call to the compare function