Added Manhattan distance function.