synched up code with tutorial