rewritten
removed and replaced by a simpler home-made module