added the const qualifier to all the compare methods