scripts updated and new functions