Adding rudimentary rules engine and stat updates