Added history functionality