few fixes to formatting and actual code