broke spatial correlation out into it's own function.
added tests