Changed headers, fixed some parameters
PEP8 and fixed to right array access for getting  the filename