use Map instead of mapply