added goodnight function