Added authorization checker
Made menu logic and state saving