Added prints, tried fixing logic