Added steps in algorithm, added params