First version : ugly but does what I need