removed unused lines, and fixes a bug with degree randomisation