Improved tabs code a bit

...although it is still shit and doesnt work properly