Added definition and temperature commands. Refactored the code a bit