added serial function stored in variable