changed ncol of all.pops.out to ncol(all.populations) rather than a fixed integer (10)
added specn.gradient and specn.factor arguments to the sim_matrix test parameters