try
    screens = Screen('Screens');
    whichscreen = max(screens);
    [w, rect] =Screen('Openwindow', whichscreen, 0);
    discdiam = 20;
    disc = [0, 0, discdiam, discdiam];
    rectinrect = [0, 0, rect(3)/2, rect(4)/2];
    rectinrect = CenterRect(rectinrect, rect);
    disc = AlignRect(disc, rectinrect, 'center', 'left');
    for i = 0:600
        Screen('FillRect', w, 255, rectinrect);
        Screen('FillOval', w, 0, [disc(1)+i, disc(2), disc(3)+i, disc(4)]);
        Screen('Flip', w);
    end
    Screen('CloseAll'); % close all
catch
    Screen('Close',w)
    rethrow(lasterror)
end