change from tabs to spaces.

fix lots of bugs, but more to go