made some style changes and fixed typos