adding possibility to read weights from files