1) code was unnecessarily converting website to all lowercase, which was causing problems with case sensitive web servers (e.g. apache). so, i changed code to evaluate as lowercase, but not reassign the variable value.  also created a reusable function, prependHTTPToWebsite, to handle that business 2) discovered some cases when website var was being declared and processed twice in the same function, so cleaned that up and simplified.