meetpoint algorithm with cube