edited menu function