i added more comments in the compare method