Updated to work with url
Updated to add other variables