Implemented Ed's inverse map function.