an attempt at fixing pulse, but not sure it's quite right.