Added time_remaining function