Modified version function.