Function nesting tripped me up, fixed.

The innermost function was returning to the outer function, which was not returning anything. Fixed using dataToReturn (ik it is hacky)