cleaned some code; updated design doc to match master