Added collapse/expand buttons functionality.