Function practice and some loop stuff