moved a function to scripts