transferred casting of stats to template and added documentation to stats model