Gilead pays $40m to settle allegations that it delayed work on an improved HIV drug to maximise profits from an older drug