Cleaned up the PHP and reduced cycles needed to complete
Merge pull request #4 from blobaugh/master

Cleaned up the PHP and reduced the cycles needed to complete the function