general fixes
some logic improvements
new method of opening tabs (hopefully will work)