add the modified q2 code(just miss committed...)