added function paramaterized debugging