fixed tabs to spaces and fixed a silly bug