implementing cl function