added parameters to the functions, scripts need updating