Add filename to getCost method