vadim improved efficieny of readWeights and stuff