Basic granulation algorithm