Change inv to a hash
Fixed merge conflict