Improved version of Randex