modified algorithms