Total modification of algo