cleaned up merged code a bit to get TABs back.