Parsing seems OK, literal algorithm makes trouble