final fixes and format