try to guess why program works wrong