lu's fixed code