moved menu function to view