base algorithm added