use mapcar instead of loop macro to remove CL package dependency