changed countdown, added sanity checks