apparently working version with mprocessing
cleaned up working version