Moved menu into function