added random tab and poor displaytab function