I recommend you split this method up by factoring the bodies of the loops out. That will reduce complexity and make this a lot easier to understand. And presumably you can then easily get rid off this odd continue statement.