final code iteration for vortex.