still working on engine

fixed some bugs, refined engine, almost finished applying core rules.