removed un used comments
added logic for active tab
changed formatting