fixed compare behaviour to match standard definition