Move manhattan distance calc for generalization

Quinten was right...