Added docs and fix as recommended by Rubocop