Learning with three factors: modulating Hebbian plasticity with errors