fixed incorrect manhattan computation