refactored whitespace code and multi-eqn