Merge algo v2. (Not fully operational)