finally got the tab nonsense working properly