How Temperature Affects the States of Matter