separate the sparse part from the dense part