mouse interaction code stable