refactoring horizontal.rb; updated logic for compute_rows_cols_and_widths to be more succinct