move datastructures to top of file