further into docs tutorial.  Not sure if I should have split some of this code into seperate files...