commit with algorithm