fixed missing braces, small formatting changes