Switching of Photochromic Molecules on Surfaces