countdown functions

adding a loop based version and a recursive version