update script, remove branch function, update arrays