rebuilt most things to support replays