Added stats-controller function