Modified code to do away with truncation funciton. Truncating manually with string formatting