refactoring horizontal; adding tests for compute_rows_cols_and_width