ADded REG file, DPI setection and complete initalise/uninitialise routines