puts function changed