major refactoring in parameters, add parameter test