reverted to tutorial code