Init code from Tim.