mapEveryOther function