tiling2 written by c, using dynamic