add tests and make history available to unit tests