another optimization: stop copying the input mol