playing with functions and loops