working script so far from the commit 35d7a053894cba43da79334e3d1be44667e16dc4