I find the use of rand here rater scary