Promises flow

Add map function to flow control.