getting history to work sensibly