replaced print statements with warnings