fixed escaping problem, started refactor of Pair object **danger:  not complete!