Adding menu and looping functions