Add code from 2 part of tutorial