added avatar generation code