updating return type to map