Fixed typos and re-organized section on writing programs