Added masonry and cleaned some code