changed argument passed to bag_resample to resolution
fixed bug in bag_merge