Fixed problem with raster distance caluculation and switched to using fields instead of vegan for making random data (faster and cleaner).