updates to truncate function