Added weighted random generator