sorting out uppercase X
finishing off sorting case