completely rewriten; expanding parameters section