Added class defs for modes and stats
Added codes