more flexible solution for grid layout