refactored scripts, add Fig to the setup