just a few changes from following the tutorial