updated sort key generation..