added truncate

Not sure if I did it right though.