some usefull code for map-red