Adding functions MAP and AP