refactored complete square and factor rules.