fixed some obvious compilation errors and indentation consistency