Added features from stats branch. Ready to deploy