Fixed the copying errors.  It compiles (thank god) but hasn't been tested