refactored again for logic and included multiply, divide, and squareroot paths