changes kwargs to dict in mapping function. plus cleaned out unwanted mapping function