RandomState() passing finally debugged and tested.