moved filepath manipulation to separate script