updated to follow tutorial to lecture 14