Added code from end of session