Source: https://eecs.wsu.edu/~ananth/CptS317/Lectures/PDA.pdf