process_url() complete. not tested. also changed a few params to use tuples.