Okay, well right off the top in your code you are setting the value for baselinetemp when the button is pressed. I would recomend creating a seperate function for callibration, call that routine in you setup funtion and then in your loop function when the button is pressed. You may need to integrate some debouncing on the button as well. Also take a look at the MAP function, it will certainly simplify your conversions.