implemented tabs (most of the way)