major rework and cleanup: start and middle are done; needs end work next