method to subdivide n times