fix typo and add source for _optimal_size()