Totally rewritten.