reposition for loop closing curly brace