corrected stuff
Have not worked on this for over a year. There are uncommited changes. I have no idea what is going on.