added minmax function to MainActivity add finish() method
onBackPressed()