Changed function for filename generating