a few bug fixes and a lot of deleted code