Detect threatens. Still handles solutions in a wrong way. solving problem 2 returns nil