Please look in workshop 4. A series is passed to a function by writing the name of the series inside the parentheses.
Do not continue here until you have read at least workshops 4 and 5. You can not write own scripts without understanding the workshops and knowing how to use variables, functions, and series. If you do not understand something from the workshops, just ask and I'll help. But as long as basic understanding is missing, continuing with your script makes no sense and will only lead to frustration.