Basic stats system implemented. Bugs fixed