removed trailing whitespaces.
many small cleanups.