Based on code derived from firestarter by Tomas Junnonen (majix@sci.fi)

