added documentation and made some source styling via rubocop