Branch for josephs comments

It's not clear what is happening in this area.  Your code should be commented so a non-programmer can read it.  Imagine your comments are a story.  Your story reads:

```
// Get the file directory.
// Specify preg_replace values, then run.
// Check to make sure the new directory is correct
// .... etc
```

This is really not readable.  You are telling a story, and people shouldn't have to do more than glance at the actual code after reading the comments.