fixed coding conventions, typos; cleaned