added active window
various improvements