minor edits to make codemore readable in computing distance between far points and volume coordinate