changed how parameters are decoded and added to functions