Script now works for all required functions