improvements to working js for menu