Removed tab() and par(); added check for tab