Functions for maping and recovering map added.