fully implements handling of parameters