sorted out menu loop