Updated Small-Time python code