Added the truncate helper method