added truncate method