new random generator & bug fixes