Moving script function to stand alone file (convert_bhv)