added edit-distance capabilities - purely functional and very fast