implemented basic history tracking and some other minor tweaks