generate stars function