Added looping input experiment
Clean up pylab windows on errors