Finished working custom routes, got rid of fugly globals