most of the hard work for basic tab done