dynamically allocate arrays in weightfile header
weightfile working, next: calculate weights