fixed compile errors and indenting