fixing some typos that were causing run.php to not work
reworked the code to present a cleaner appearance, also rewrote some debugging lines