added active state to buttons, and helper methods to ensure correct button is active