added a little function script from random chapter script