better example for function that returns hash