cleanups and some work on block encryption