Completed implementation of get_dim_size