Replaced arbitrary case numbers with enum values; added exit functionality