added phase 2-4 rules, still debugging