Update main.pas

Life 6.1
[Optimization] Some local variables now global.