implementing truncate