Working implementation of mesh expansion