Created reduced recursive map function