modified to fit functionnal requirements