Renamed "filename" variable to "filepath"