fix errors and change tabs to spaces