a first version; saved the page we're basing it on and started making the code a bit more sane