first version of countdown

using global variables