fix tab and space mix

tab and space was mixed
I unified them as space.
If you like switch is better than else if. I will fix it too