http://qs321.pair.com?node_id=1216739


in reply to error at line 77

Unless you're just doing this as an exercise, there is a module that does this.