replace magic number 2 by variable