COSMITS: add docstring, simplify expressions