fixing manhattan number bug