had some minor typos in the code