Moved "public" functions to the top of file