some fixes and formatting