fixed bug in history (#39) and refactored