top level mapping function - initial commit