correct manhattan calculation method
remove redundant non-null checking

Findbugs gives a warning here