set parameter ranges and removed more unused code