Updated the plan
code rearragements
Tiny changes
Fixed unit tests