Modified for new scripts