tidied the tab functionality and added settings for it.