added a function that chunks up history and a test that ensures it does it correctly