Added more history/state functionality