Replaced bytes_to_closest with old new, because it is actually slightly faster