Modified main.pas