Updated design doc and added comments