minor fixes and beautified