remove unnecessary code
add ability to close window using meta-w