renamed file to str to better reflect input type