remade debugging, checking type and code on str: 178 - 191