Before my adaption to the real code
Try 1st version

Still need to adapt the code