added changes to boolean switching code, modified temperature structure