rearranged some code, started the cleansing function

I'm beginning to like Java