Added history print out
Fixed printing issues
Did some more refactoring