Added start of top level function.
Change flow vectors