Fixed typos and added code