Acquired import code from GWSF. Obviously requires adaptation.