Dynamics of ligand binding to heme proteins