Updated plan.md. Updated design and implementation