Changed ridiculous if/else to a switch

Fixes formatting?

weird Formatting was not showing up on my fork/branch

combined case 1 & 2

fixed whitespace
Merge branch 'patch-2' of ssh://github.com/alecho/tools into patch-2