fixed some typos and code formatting