moved to functions and using params.pp file