use sizes n, m in data construction