added preliminary random generator function