DEF lets you make user defined funtions. They can contain parameters and optionally return results. You can also define variables belonging to just that function. With user defined functions you can do recursion too. Basically like Gosub but much much better. I recommend user defined functions over gosub in virtually in every case.