Added the logic for the mapper