Functions can also be written. You could probably write a function that did your first question. I hope all this helps. If you have questions, please ask them.