Started testing, debugging the loop
Cleaned up some errors