merge algo draft