added function for inflow and outflow for maps