For now I prefer to keep it like this, I think that is easier to understand what is happening in this function... What do you think @Garyfallidis ?