Edited with URL processing code