Working implementation of Arnoldi in C (without crashes)