Added possibility for result to be a hash