enhanced flatmap test