Single molecule optical absorption by STM and a new algorithm for solving dynamics on a free energy surface