fixing typos and bugs