Wrote code to generate control functions, as well as code to test it. Also wrote code to make raster plot. Also edited code to first calculate distance matrix, and then calculate ratios.