remove last debug prints, move all to logging