This code came out of a step by step tutorial I wrote previously - start at the beginning and make it grow - it is not supposed to be cut and paste.