Source: http://www.cse.unsw.edu.au/~cs1911/15s1/lec/chars_handout.pdf