implementing flexible grid.