code cleanup
working loop breakout