added Lu's code