Sharding implementation for 3 shards

Has an off-by-one error, but shards seem roughly correct