altered sem func in mstats to match stats