Based off a code sample authored by Jeffrey Way.