Added manhattan distance function