This code is LGPL-ed.