Removed some print statements, refactored truncate_at_attr