add -W and refactored a lot of code out of main, commented out the last part of equal width