@rande: Ok so this lines are ok for you. Wasn't sure if it's the preferred way… But works quite well. 
So I'm going to remove the comments in the code above.