function practice and some loop stuff