Dynamo code for part 3. Not sure why it is not working thought