Changed to code of an older version that uses randomness in sig generation