Tobias' initial code.