added comments to tab function