modified some things to make it suitable with the tutorial