converting to float is not necessary, if you preallocate ``chisq`` below as float, I think