Use if statement instead of begin