Moved script around to resolve dependencies