Refactor: return nil, else a solution (lines 3-4)