fixed problem caused by commenting out unused variables in earlier commit, only affected running on data