Added filename parameter.