Changed 'filename' to 'filepath' for clarity