manhattan distance plus minor edits

minor edits include clean up of variables, text, and comments