temp filename now includes value of N