all menu functions implemented and working, refactoring and tweaks