added some logic when no docs were pulled, jshint'ed code, fixed some logic