update to master script, minor formatting changes