Updated code to use prefix ++/-- operators for non-primitive types and fixed some typos in the comments.