Add history feature (TODO: layout is ugly)