Improved tabs and window focus
Add old code that may be used later