It's basically a loop, but it works

http://www.divshare.com/download/16437382-d45