Output parsing

SemiFinal version, syntax errors need to be fixed. Testing needed.