Adding all of the preexisting code.