 			gallons = (gallonsTextField.text as NSString).doubleValue
 		}
 		
-		if (miles == 0){
+		if (miles == 0 || gallons == 0){
 			mpg = 0.0
-		}else if(gallons == 0){
-			mpg = 99.9
-		}else{
+            mpgLabel.text = String(format: "%.2f MPG", mpg)
+		} else {
 			mpg = miles / gallons
-		}
-		
-		mpgLabel.text = String(format: "%.2f MPG", mpg)
+            mpgLabel.text = String(format: "%.2f MPG", mpg)
+		}
     }
     
     func updateButtonsAndRecords(editing : Bool) {

    }
    
    @IBAction func pressedLogIt(sender: AnyObject){
        var miles = (milesTextField.text as NSString).floatValue
        var gallons = (gallonsTextField.text as NSString).floatValue
        var cost = (costTextField.text as NSString).floatValue

    @IBOutlet weak var carPicker: UIPickerView!
	
    var cars = [GTLGasstatsCar]()
    var tankRecord = GTLGasstatsTankRecord()
	var _refreshControl : UIRefreshControl?
	var mpg: Double = 0.0
    var statCount: NSNumber = 0
	
	override func viewWillAppear(animated: Bool) {
		_queryForCars()
        _queryForGasstats(NSNumber.init(integer: 0), userId: self.user_id)
        _queryForTankRecord(NSNumber.init(integer: 0), userID: self.user_id)
	}
	
    override func viewDidLoad() {
