Slight tweaking of main program