Fixed a horrible bug -- changed filename -> filenum