added random test code for Singular implementation by Eder & Perry