elements_needed --> size_to_length and bytes_needed --> length_to_size