Fixed logic, format, and dependencies according to line note comments from last pull request. Tested on apache localhost server.