moved debug section, minor formatting changes