A literal algorithm implementation