Make filename a parameter and use it