The python call in MATLAB works now. The bug was that the code needs to start with index 1.
Got rid of vestigal print statements