debugged loop further, still troubleshooting.