Implemented mesh building