How do I use functions in a menu system?