Changed how mtrand is found