eliminate subfunctions from main script