original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major style changes (KNF, pull i386 comments in, et al.) plus converting to config.new by me.