renamed variables, allowed for variable delay