Slightly more functional inverse-map function