You will not have any problem in merging this.
I've just added an 'if'.
Ah, also, I created a new variable 'attributeP'.
There is no meaning in starting from ceP every time you need that pointer, even calling a method to find it.

When you merge, please keep this help variable that makes the code easier to read and a lot faster.