Add chunk implementation from old code base