implement toggling between grid and list