fixed some typos and bugs