debugged and unit tested WindowGate_updateOutput