Code written to answer SO questions.