Masonry grid implementation