more fixes and formatting