fix URL deprecated function usage; and added comments