drawing closed paths for loops