Added code according to tutorial