This method definitely works; it's hard to read though. 

Could you rewrite it using the constraint that a method should be no more than 3 lines long?