updated babylon function