changed back output to result struct