Adding RandomState implementation and improving heuristic.