added esc to exit, removed dead code