#get_dimensions a bit modified