Removed test code from main loop
Reformatted connect method. Looking to clarify nsflg usage