improved test prog. now closes when escape key is hit