modified for second branch