Moved script to it's own file