Added code to automatically take screen shots.