fixing max temp indexing