added logic for generating random individual