Changed temp file paramter to account for multiple situations.