Cleaned up / commented EditDistance