adding temperature and revised functional.js