Moved script into external file