getting code from richard