better circling algorithm