code from the rust tutorial