modified goodbye.R