moved returnResult into return statement

moved returnResult under return statement to make the code syntactic
(now returnResult can be