not clear to me why we need to switch between tabs. any specific reason? if so, add comments explaining logic behind it.