moved script to main