added n == 5 case