adding algo part