Do a case insenstive compare then case sensitive compare and finally