some basic Algorithm or Algorithm_apply codes.