added DMA slave code from testing with justin