reorganized code structure. added random partition.
Merge pull request #2 from echu/master

reorganized code structure. added random partition.