fixes #9, fixes #7, and fixes #6
fixed rubocop warnings