Added Stats page and modified supporting functions in the controller