diff --git a/src/graph.js b/src/graph.js
index <HASH>..<HASH> 100644
--- a/src/graph.js
+++ b/src/graph.js
@@ -42,7 +42,7 @@ module.exports = function(grafine) {
      * Retrieves a shard from the specified uuid
      */
     graph.prototype.shard = function(uuid) {
-        var id = uuid % this.hash;
+        var id = ((uuid - (uuid % this.hash)) / this.hash) % this.hash;
         if (!this.shards[id]) {
             this.shards[id] = this.createShard(id);
         }
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -1,7 +1,7 @@
 var should = require("should");
 
 var grafine = require('../index');
-var db = new grafine.graph();
+var db = new grafine.graph(2);
 describe('Test points', function() {
     var a, b;
     it('should create', function() {
avoid points dispersion between shards