add truncate method
rename function