python implementation of the temp