use request.referer instead of NIH solution; nit-picky comments on where methods belong
better routing and solution for sorting (plus a UX suggestion)