added check for NaN
added buttons for heat map functionality