handles the "x times with variable" notation