replaced repeating  with a variable