some progress, contains undiscovered infinite loops...