Main menu function modified