fixed typos and coding problems