move doc to top of function