recursive find mid point and link each mid point