Progress on moving this code over and testing