Rewrite basic version
Make basic able to handle data size > node num