Add history class and a bunch of badly written code for it :D