tried adding pdb to help debug code. error probably in numpy array