Change filename to jobname.
Change int matrix to float matrix. Fix bugs.