This is incredibly slow, considering there are only 10000*20 insertions. Might take a look at speeding this up later.