modified to pass rubocop tests