Added handling of injective functions