fixed lot of typos and bugs