Fixed bug in algorithm and changed plot

All bugs cleared - Plot now saves as a PDF an makes a distinction
between reversals after a correct answer and after a wrong answer.