Totally rewritten / updated grid generator function
progress towards chi squared fitting - I thought I'd commited this already