code cleaning and spelling improvements