rearrange code put static at top of function list