Alright, there were still some bugs. Now they're fixed. Again, this version has print statements that will be removed.