copy the input mol once to avoid modifying the input