applied changes from tutorial, for testing purpose