refactoring to be closer to the evaluator js in WeScheme