reorganized this script