modified to match vortex_denstiy.m