added some printlines, still not sure where the bug is coming from