added conditions to generate nearest
Merge branch 'master' of https://github.com/Bradshaw/octo-hipster