Added debug URLs and moved around functions