Reordered the functions a bit, made a main() function, made constants global, changed urls and changed internet on test