Python Time Monotonic Stack Problems