removed result function as it is only used once