added degreeLogs code to rand alg