added remaining rules. Minor bug fixes on factoring rules