alternative way to do the ruby one for p9
work on p9