algorithm added