Added comments, fixed more new bugs. Added function that runs N episodes and computes average and stdev