now passes all unit tests again
minor cleanups