changed to result array