Changing grid functions to flexbox grid