initial commit with changes I've made - removed split and replaced with
explode as split is deprecated, also made a couple of changes to prevent
warnings from popping up when the parameter is not there.