minor tweaks; some parameters still hard-coded