Added collapse and expand function