fixed typos and bugs