make lines of code into a function