Are you sure that you shouldn't be doing 'alpha[0]': looking at line 162, alpha seems to be a 2D array.