DEV: Add beginning of correct implementation : old one was too complicated