add sequence algorithm