Add logic for returning a result hash